<template>
  <div class="mask">
    <div class="mask-header">
        <div class="mask-header-con">
            <span class="iconfont left" @click="hiddleMask">&#xe668;</span>
            <span class="header-con">{{userInfo.postLabel}}</span>
            <span class="iconfont right">&#xe73a;</span>
        </div>
    </div>
    <div class="personal">
      <div class="personal-img">
        <img :src="userInfo.headImg" alt />
      </div>
      <div class="personal-rig">
        <div class="per-con">
          <div class="per-con-cn1-num">{{userInfo.userName}}</div>
          <div class="per-con-cn1-huozan">{{userInfo.date}}</div>
        </div>
        <div class="per-con2">
          <p class="per-con2-cn1">+</p>
          <p class="per-con2-cn2">关注</p>
        </div>
      </div>
    </div>

    <div class="post">
      <p class="post-con">{{userInfo.content}}</p>
      <!-- <div class="post-img">
        <img :src=userInfo.imgUrl />
      </div>
      <p class="post-label">{{userInfo.postLabel}}</p>-->
    </div>
    <div class="line-huifu">{{userInfo.reply}}条回复</div>
    <div class="comment">
      <div class="c-item" v-for="(item,index) in commentList" :key="index" @click="navTo(item)">
        <div class="c-top">
          <div class="c-top-img">
            <img :src="item.imgUrl" alt :onerror="noImg" />
          </div>
          <div class="c-top-rig">
            <div class="c-top-cen">
              <p class="c-top-cen-cn1">{{item.userName}}</p>
              <p class="c-top-cen-cn2">{{item.date}}</p>
            </div>
            <div class="c-top-zan">
              <div class="iconfont shanchu">&#xe60c;</div>
              <p class="c-top-zan-cn2">{{item.zanNum}}</p>
            </div>
          </div>
        </div>
        <template v-if="item.content">
          <div class="c-con">
            <p class="c-con-cen">{{item.content}}</p>
            <template v-if="item.reply">
              <span class="c-con-reply" @click="reply1">
                {{item.reply}}条回复
                <em class="iconfont right">&#xe606;</em>
              </span>
            </template>
            <template v-else>
              <span class="c-con-reply" @click="reply2">回复</span>
            </template>
          </div>
          <div class="line-p"></div>
        </template>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "replyDetails",
  props: {
    commentList: Array,
    userInfo: Object
  },
  data: function() {
    return {
      noImg: 'this.src="/static/img/header.png"',
      showMask:false
    };

  },
  methods: {
    navTo(item) {
      console.log(item);
    },
    reply1(){

    },
    reply2(){

    },
    hiddleMask(){
        this.$emit('hiddleMask1',this.showMask)
    }
  },
  
};
</script>
<style lang='less' scoped>
img,
video {
  width: 100%;
  height: 100%;
}
.line-h,.line-h2 {
  background: #dfe1e3;
  width: 100%;
  height: 1px;
  margin-top: 0.14rem;
}
.line-h2{
    margin-top: 0;
}
.line-w {
  width: 100%;
  height: 0.11rem;
  background: #f5f8fb;
}
.line-huifu {
  padding: 0 0.24rem;
  height: 0.54rem;
  background: #f5f8fb;
  font-size: 0.28rem;
  color: #4f4f4f;
  font-weight: 600;
  line-height: 0.54rem;
}
.mask {
  width: 100%;
  background: #ffffff;
  border-top-left-radius: 0.4rem;
  border-top-right-radius: 0.4rem;
  z-index: 10;
  position: fixed;
  left: 0;
  overflow: auto;
  bottom: .8rem;
  height: calc(100vh - 1.4rem);
  .mask-header{
      position: fixed;
      width: 100%;
      height: 1rem;
      background: #ffffff;
      border-bottom: 1px solid #dfe1e3;
      border-top-left-radius: 0.4rem;
      border-top-right-radius: 0.4rem;
      z-index: 11;
      .mask-header-con{
        display: flex;
        justify-content: space-between;
        padding: 0 0.3rem 0 0.24rem;
        align-items: center;
        height: 1rem;
        .left , .right{
            font-size: .36rem;
        }
        .header-con{
            font-size: .36rem;
            color: #4E4E4E;
            font-weight: 600;
        }
      }
      
  }
}
.personal {
  display: flex;
  padding: 0.24rem 0.3rem 0.24rem 0.24rem;
  align-items: center;
  position: relative;
  margin-top: 1rem;
//   justify-content: space-between;
  .personal-img {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    overflow: hidden;
  }
  .personal-rig {
    display: flex;
    align-items: center;
    height: 1.1rem;
    margin-left: .28rem;
    // width: 5.56rem;
    // justify-content: space-between;
    .per-con {
      display: flex;
      flex-direction: column;
      justify-content: space-evenly;
      height: 1.1rem;

      .per-con-cn1-num {
        font-size: 0.3rem;
        color: #4e4e4e;
        font-weight: 600;
      }
      .per-con-cn1-huozan {
        letter-spacing: 2px;
        color: #7d7d7d;
      }
    }
    .per-con2 {
      position: absolute;
      right: .3rem;
      border-radius: 0.05rem;
      width: 1.24rem;
      height: 0.6rem;
      text-align: center;
      background: linear-gradient(0deg, #6fc434, #a8e23b);
      color: #ffffff;
      font-size: 0.3rem;
      display: flex;
      align-items: center;
      font-weight: 600;
      justify-content: center;
      .per-con2-cn2 {
        margin-left: 0.02rem;
      }
    }
  }
}
.post {
  padding: 0 0.3rem 0.3rem 0.3rem;
  .post-con {
    font-size: 0.28rem;
    color: #7d7d7d;
    word-break: break-all;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    line-height: 1.3;
  }
  .post-img {
    width: 100%;
    height: 3.2rem;
    padding: 0.16rem 0;
  }
  .post-label {
    width: 1.6rem;
    height: 0.5rem;
    background: #f5f8fb;
    color: #828181;
    font-size: 0.28rem;
    letter-spacing: 2px;
    line-height: 0.5rem;
    text-align: center;
  }
}
.comment {
  width: 100%;
  .c-item {
    width: 100%;
    .c-top {
      padding: 0.2rem 0.3rem 0 0.12rem;
      display: flex;
      //   justify-content: space-between;
      align-items: center;
      position: relative;
      height: 1.1rem;
      .c-top-img {
        width: 1.1rem;
        height: 1.1rem;
        border-radius: 50%;
        overflow: hidden;
      }
      .c-top-rig {
        display: flex;
        // justify-content: space-between;
        height: 1.1rem;
        align-items: center;
        margin-left: 0.28rem;
        // width: 5.6rem;
        .c-top-cen {
          display: flex;
          flex-direction: column;
          justify-content: space-evenly;
          height: 1.1rem;
          .c-top-cen-cn1 {
            color: #4e4e4e;
            font-size: 0.3rem;
            font-weight: 600;
          }
          .c-top-cen-cn2 {
            color: #7d7d7d;
            font-size: 0.28rem;
          }
        }
        .c-top-zan {
          position: absolute;
          right: 0.3rem;
          display: flex;
          align-items: flex-end;
          font-size: 0.4rem;
          height: 0.4rem;
          color: #6d6d6d;
          .c-top-zan-cn2 {
            font-size: 0.28rem;
            color: #828181;
            margin-left: 0.1rem;
          }
        }
      }
      .shanchu {
        color: #6d6d6d;
        font-size: 0.38rem;
        font-weight: 600;
      }
    }
    .c-con {
      margin: 0 0.31rem 0.2rem 1.5rem;
      .c-con-cen {
        line-height: 1.3;
        color: #7d7d7d;
        font-size: 0.28rem;
        letter-spacing: 1px;
        word-break: break-all;
        text-overflow: ellipsis;
        display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
        -webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
        -webkit-line-clamp: 3; /** 显示的行数 **/
        overflow: hidden; /** 隐藏超出的内容 **/
        margin-bottom: 0.2rem;
      }
      .c-con-reply {
        border: 1px solid #4e4e4e;
        padding: 2px 5px;
        color: #4e4e4e;
        border-radius: 3px;
      }
      .right {
        font-size: 0.28rem;
      }
    }
    .line-p {
      background: #dfe1e3;
      height: 1px;
      // margin: 0 .31rem;
    }
  }
}
</style>